package run;

import jade.core.Profile;
import jade.core.ProfileImpl;
import jade.wrapper.AgentContainer;
import jade.wrapper.AgentController;
import jade.wrapper.StaleProxyException;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * Test Class
 *
 * @author Group 7
 */
public class Main {

    public static void main(String[] args) {
        jade.core.Runtime rt = jade.core.Runtime.instance();
        Profile p = new ProfileImpl();
        p.setParameter(Profile.GUI, "true");
        AgentContainer c = rt.createMainContainer(p);
        try {
           
            AgentController machine01 = c.createNewAgent("cutting01", "agents.machine.MachineAgent", new Object[] {"cutting"});
            machine01.start();
            AgentController machine02 = c.createNewAgent("sewing01", "agents.machine.MachineAgent", new Object[] {"sewing"});
            machine02.start();
            AgentController machine03 = c.createNewAgent("packing01", "agents.machine.MachineAgent", new Object[] {"packing"});
            machine03.start();
            
            
            AgentController client01 = c.createNewAgent("client01", "agents.client.ClientAgent", null);
            client01.start();
            
            AgentController client02 = c.createNewAgent("client02", "agents.client.ClientAgent", null);
            client02.start();
            
            AgentController client03 = c.createNewAgent("client03", "agents.client.ClientAgent", null);
            client03.start();
            
            AgentController manager01 = c.createNewAgent("manager01", "agents.manager.ManagerAgent", null);
            manager01.start();
        } catch (StaleProxyException ex) {
            Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);
        }
        
    }
}
